package entities;

import play.db.ebean.Model;

import javax.persistence.*;

import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: eagami
 * Date: 01/12/13
 * Time: 00:33
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="Tag")
@SequenceGenerator(name="Tag_sequence")
public class Tag extends Model implements Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = -790339686028416532L;

	private Long id;
	private Integer number;
    private String name;
  

    public static Finder<Long,Tag> find = new Finder<Long,Tag>(
            Long.class, Tag.class
    );
    
    public Tag() {
		// TODO Auto-generated constructor stub
	}

    @Id
    @Column(name = "Tag_id")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
    
	@Column(name="Number",unique=false,length=20,nullable=true)	
	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	@Column(name="Name",unique=false,length=20,nullable=true)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@play.db.jpa.Transactional
    public static List<Tag> getAllTags(){
        return Tag.find.all();
    }
}
